const axios = require("axios");
const requestData = async (idx, job) => {
  let data = {
    model: "concise",
    messages: [
      {
        role: "user",
        content: `给我写一篇400字左右的实习${job}岗位的周志,这周为第${idx}周,不要有任何ai的痕迹,也不要暴露任何的人名和地名。`,
      },
    ],
    stream: false,
  };
  let response = await axios.post(
    "http://localhost:8000/v1/chat/completions",
    data,
    {
      headers: {
        Authorization:
          "Bearer 66a1f3bd700edf044900cfb8-6af7c8d7b1fd44848000a599435161ab,672b29975a04319be0154082-0876086bb1b84f8b8e3525ee997c5f0d,672b2b8fc472b7adb672973b-857b4c55c0454627a655aa521a81d522,672b3757255c14b93f093de7-3d041a97950f4e37b7654e86c5bc26ae",
      },
    }
  );
  return response.data.choices[0].message.content;
};

module.exports = { requestData };
